package com.ggh.jinjilive.dialog;

import android.content.Context;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;

import com.alibaba.android.arouter.launcher.ARouter;
import com.blankj.utilcode.util.LogUtils;
import com.ggh.jinjilive.R;
import com.ggh.jinjilive.utils.ARouterUtils;
import com.cy.dialog.BaseDialog;

public class ReleaseDialog extends BaseDialog {

    public ReleaseDialog(Context context) {
        super(context);
    }

    public ReleaseDialog(Context context, int themeResId) {
        super(context, themeResId);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_release);
        animType(AnimInType.BOTTOM);
        canceledOnTouchOutside(true);
        findViewById(R.id.button_start_live).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
                //创建直播
                ARouter.getInstance().build(ARouterUtils.CreateLiveActivity).navigation();
            }
        });

        findViewById(R.id.button_shooting_video).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                LogUtils.d("发布视频");
            }
        });

        findViewById(R.id.button_voice).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                LogUtils.d("语音派对");
            }
        });
    }



    @Override
    public void show() {
        super.show();
        Window window = getWindow();
        //设置弹出位置
        window.setGravity(Gravity.BOTTOM);
        //设置对话框大小
        window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    }
}
